import service from '@/utils/request'

export const getSysDemoApiUrl = (type:string)=>{
    if(type=='add'){
        return '/sys/demo/add'
    }else if(type=='edit'){
        return '/sys/demo/edit'
    }else if(type=='delete'){
        }else if(type=='list'){
        return '/sys/demo/list'
    }else if(type=='detail'){
        return '/sys/demo/detail'
    }
}

export const getSysDemoInfoApi = () => {
    return service.get('/sys/demo/info')
}

export const updateSysDemoPasswordApi = (data: any) => {
    return service.post('/sys/demo/password', data)
}

export const useSysDemoApi = (id: number) => {
    return service.get('/sys/demo/' + id)
}

export const useSysDemoSubmitApi = (dataForm: any) => {
    if (dataForm.id) {
        return service.post('/sys/demo/edit', dataForm)
    } else {
        return service.post('/sys/demo/add', dataForm)
    }
}

